﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PDO.DataPersistence.Core
{
    // See the attribute guidelines at http://go.microsoft.com/fwlink/?LinkId=85236        

    /// <summary>
    /// Attribute used to decorate PersistableDataObject derived classes to provide a stored procedure naming template.
    /// This template basically a string format statement used to generate standard stored procedure 
    /// names for operations such as Create, Insert, Update, etc.
    /// 
    /// Example:
    ///    For an attriubute of:
    ///         [SProcTemplate(Template = "[NeuroCare].[spgActivity{0}]")]
    ///         
    ///    The standard sproc name for an insert operation would be:
    ///         [NeuroCare].[spgActivityInsert]f
    /// </summary>
    [global::System.AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
    public class SProcTemplateAttribute : Attribute
    {
        private string _templateProperty;


        public string Template
        {
            get { return _templateProperty; }
            set { _templateProperty = value; }
        }

        public SProcTemplateAttribute()
        {
        }

        public SProcTemplateAttribute(string sprocTemplateProperty)
            : this()
        {
            Template = sprocTemplateProperty;
        }
    }
}
